{% extends "master/layout.html" %}
{% block formTitle %}
<form method="post" action="/cmdb/index/wf/add/">
{% endblock %}
{% block content %}

        <div class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card p-4">

                            <div class="card-header bg-light">
                                添加流程<label style="color: red;">{{status}}</label>
                            </div>

                            <div class="card-body">

                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="sponsor" class="form-control-label require">发起人</label>
                                            <input type="text" id="sponsor" class="form-control" readonly value="{{login_user}}" name="sponsor">
                                        </div>
                                    </div>

                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="title" class="form-control-label require">标题</label>
                                            <input type="text" id="title" class="form-control" name="title">
                                        </div>
                                    </div>

                                    <!--
                                    <div class="col-md-7">
                                        <div class="form-group">

                                            <label for="date" class="form-control-label require">执行时间</label>
                                            <input type="datetime-local" id="date" class="form-control" name="date">

                                        </div>
                                    </div>-->


                                   <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="single-select1" class="require">请求类型</label>
                                            <select id="single-select1" class="form-control" name="type">
                                                {% for item in wf_type %}
                                                <option value={{item.id}}>{{item.name}}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>



                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="textarea1" class="require">请求内容</label>
                                            <textarea id="textarea1" class="form-control" name="content"></textarea>
                                        </div>
                                    </div>





                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="single-select" class="require">审批人</label>
                                            <select id="single-select" class="form-control" name="approval">
                                                {% for item in user_group %}
                                                <option value={{item.id}}>{{item.leader}}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>


                                    <div class="col-md-7">
                                        <div>
                                            <label for="file" class=" require">添加附件</label>
                                            <input type="file"  id="file"  name="file" multiple onclick="upload()">
                                            <button type="button" id="file1"  name="file" onclick="upload()">上传</button>
                                        </div>
                                    </div>



                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label for="textarea">备注</label>
                                            <textarea id="textarea" class="form-control" rows="6" name="memo"></textarea>
                                        </div>
                                    </div>
                            </div>

                            <div class="card-footer p-4">
                                <div class="row">
                                    <div class="col-5">
                                        <button type="submit" class="btn btn-primary px-5">添加</button>
                                    </div>
                                    <div class="col-5">
                                        <a href="/cmdb/index/wf/" class="btn btn-outline-primary px-5">取消</a>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>

{% endblock %}
{% block formFooter %}
</form>
{% endblock %}

{% block javascript %}
<script>
function upload() {

          /*  $.ajax({
               url: '/cmdb/index/wf/upload/',
               data: {userid:id,username:username,password:password,email:email,usertype:usertype},
               type: 'POST',
                success: function (data) {
                    //alert('更新成功')
                    //window.parent.location.reload();
                   //$(body).html(data);
              },
               error: function () {
                 alert('服务器异常');
              }
          });*/

          alert( hello,world)

    }

</script>
{% endblock %}